<template>
    <div class="text-red text-color-red">
        test11100==={{$t("common.ok")}}==={{$t("test.test1")}}<br>
        serverApi => {{JSON.stringify(myData)}}<br>
        vuex => {{getCount}}
    </div>
</template>

<script>
// 模块样式
import '../style/style.less'
import { mapMutations, mapGetters } from 'vuex'
import { testApi } from '../scripts/api'
export default {
  data () {
    return {
      myData: {}
    }
  },
  computed: {
    ...mapGetters('myModule', [
      'getCount'
    ])
  },
  methods: {
    ...mapMutations('myModule', [
      'increment'
    ])
  },
  created () {
    testApi().then((resp) => {
      console.log('=======resp=======', resp.data)
      this.myData = resp.data
    })
    this.increment() // this.$store.commit('myModule/increment')
    console.log('===$store====', this.$store.state.myModule.count)
  },
  mounted () {
  }
}
</script>

<style lang="less" type="text/less">
    .text-color-red{
        height: 500px;
        //background: url("../../../modules/resource/nonedata.png");
    }
</style>
